
Ext.define('ZO0.view.shipping.UPSRate', {
    extend: 'Ext.grid.Panel',
    alias: 'widget.upsrate',

    title: 'Rates',
    store: 'shipping.UPSRate',

    frame: true,
    columnLines: true,
    selType: 'cellmodel',

    initComponent: function() {
        var me = this;

        me.afterEdit = function() {
            var cell = me.getView().getSelectionModel().getSelection()[0];
            cell.commit();
	};
        me.editing = Ext.create('Ext.grid.plugin.CellEditing');
	me.editing.addListener('afteredit', me.afterEdit);

        Ext.applyIf(me, {
            height: 400,
            plugins: [me.editing],
            viewConfig: { stripeRows: true },
            columns: [
                {
                    xtype: 'gridcolumn',   header: 'Weight', dataIndex: 'weight', width: 70, align: 'center', locked: true
                }, {
                    xtype: 'numbercolumn', header: 'z2',  dataIndex: 'z2', width: 70, align: 'right', renderer: 'usMoney', sortable: false, menuDisabled: true,
                    editor: { xtype: 'numberfield', allowBlank: false, minValue: 0, maxValue: 500 }
                }, {
                    xtype: 'numbercolumn', header: 'z3', dataIndex: 'z3', width: 70, align: 'right', renderer: 'usMoney', format:'0.00', sortable: false, menuDisabled: true,
                    editor: { xtype: 'numberfield', allowBlank: false, minValue: 0, maxValue: 500 }
                }, {
                    xtype: 'numbercolumn', header: 'z4', dataIndex: 'z4', width: 70, align: 'right', renderer: 'usMoney', sortable: false, menuDisabled: true,
                    editor: { xtype: 'numberfield', allowBlank: false, minValue: 0, maxValue: 500 }
                }, {
                    xtype: 'numbercolumn', header: 'z5', dataIndex: 'z5', width: 70, align: 'right', renderer: 'usMoney', sortable: false, menuDisabled: true,
                    editor: { xtype: 'numberfield', allowBlank: false, minValue: 0, maxValue: 500 }
                }, {
                    xtype: 'numbercolumn', header: 'z6', dataIndex: 'z6', width: 70, align: 'right', renderer: 'usMoney', sortable: false, menuDisabled: true,
                    editor: { xtype: 'numberfield', allowBlank: false, minValue: 0, maxValue: 500 }
                }, {
                    xtype: 'numbercolumn', header: 'z7', dataIndex: 'z7', width: 70, align: 'right', renderer: 'usMoney', sortable: false, menuDisabled: true,
                    editor: { xtype: 'numberfield', allowBlank: false, minValue: 0, maxValue: 500 }
                }, {
                    xtype: 'numbercolumn', header: 'z8', dataIndex: 'z8', width: 70, align: 'right', renderer: 'usMoney', sortable: false, menuDisabled: true,
                    editor: { xtype: 'numberfield', allowBlank: false, minValue: 0, maxValue: 500 }
                }, {
                    xtype: 'numbercolumn', header: 'z302', dataIndex: 'z302', width: 70, align: 'right', renderer: 'usMoney', sortable: false, menuDisabled: true,
                    editor: { xtype: 'numberfield', allowBlank: false, minValue: 0, maxValue: 500 }
                }, {
                    xtype: 'numbercolumn', header: 'z303', dataIndex: 'z303', width: 70, align: 'right', renderer: 'usMoney', sortable: false, menuDisabled: true,
                    editor: { xtype: 'numberfield', allowBlank: false, minValue: 0, maxValue: 500 }
                }, {
                    xtype: 'numbercolumn', header: 'z304', dataIndex: 'z304', width: 70, align: 'right', renderer: 'usMoney', sortable: false, menuDisabled: true,
                    editor: { xtype: 'numberfield', allowBlank: false, minValue: 0, maxValue: 500 }
                }, {
                    xtype: 'numbercolumn', header: 'z305', dataIndex: 'z305', width: 70, align: 'right', renderer: 'usMoney', sortable: false, menuDisabled: true,
                    editor: { xtype: 'numberfield', allowBlank: false, minValue: 0, maxValue: 500 }
                }, {
                    xtype: 'numbercolumn', header: 'z306', dataIndex: 'z306', width: 70, align: 'right', renderer: 'usMoney', sortable: false, menuDisabled: true,
                    editor: { xtype: 'numberfield', allowBlank: false, minValue: 0, maxValue: 500 }
                }, {
                    xtype: 'numbercolumn', header: 'z307', dataIndex: 'z307', width: 70, align: 'right', renderer: 'usMoney', sortable: false, menuDisabled: true,
                    editor: { xtype: 'numberfield', allowBlank: false, minValue: 0, maxValue: 500 }
                }, {
                    xtype: 'numbercolumn', header: 'z308', dataIndex: 'z308', width: 70, align: 'right', renderer: 'usMoney', sortable: false, menuDisabled: true,
                    editor: { xtype: 'numberfield', allowBlank: false, minValue: 0, maxValue: 500 }
                }, {
                    xtype: 'numbercolumn', header: 'z202', dataIndex: 'z202', width: 70, align: 'right', renderer: 'usMoney', sortable: false, menuDisabled: true,
                    editor: { xtype: 'numberfield', allowBlank: false, minValue: 0, maxValue: 500 }
                }, {
                    xtype: 'numbercolumn', header: 'z203', dataIndex: 'z203', width: 70, align: 'right', renderer: 'usMoney', sortable: false, menuDisabled: true,
                    editor: { xtype: 'numberfield', allowBlank: false, minValue: 0, maxValue: 500 }
                }, {
                    xtype: 'numbercolumn', header: 'z204', dataIndex: 'z204', width: 70, align: 'right', renderer: 'usMoney', sortable: false, menuDisabled: true,
                    editor: { xtype: 'numberfield', allowBlank: false, minValue: 0, maxValue: 500 }
                }, {
                    xtype: 'numbercolumn', header: 'z205', dataIndex: 'z205', width: 70, align: 'right', renderer: 'usMoney', sortable: false, menuDisabled: true,
                    editor: { xtype: 'numberfield', allowBlank: false, minValue: 0, maxValue: 500 }
                }, {
                    xtype: 'numbercolumn', header: 'z206', dataIndex: 'z206', width: 70, align: 'right', renderer: 'usMoney', sortable: false, menuDisabled: true,
                    editor: { xtype: 'numberfield', allowBlank: false, minValue: 0, maxValue: 500 }
                }, {
                    xtype: 'numbercolumn', header: 'z207', dataIndex: 'z207', width: 70, align: 'right', renderer: 'usMoney', sortable: false, menuDisabled: true,
                    editor: { xtype: 'numberfield', allowBlank: false, minValue: 0, maxValue: 500 }
                }, {
                    xtype: 'numbercolumn', header: 'z208', dataIndex: 'z208', width: 70, align: 'right', renderer: 'usMoney', sortable: false, menuDisabled: true,
                    editor: { xtype: 'numberfield', allowBlank: false, minValue: 0, maxValue: 500 }
                }, {
                    xtype: 'numbercolumn', header: 'z224', dataIndex: 'z224', width: 70, align: 'right', renderer: 'usMoney', sortable: false, menuDisabled: true,
                    editor: { xtype: 'numberfield', allowBlank: false, minValue: 0, maxValue: 500 }
                }, {
                    xtype: 'numbercolumn', header: 'z225', dataIndex: 'z225', width: 70, align: 'right', renderer: 'usMoney', sortable: false, menuDisabled: true,
                    editor: { xtype: 'numberfield', allowBlank: false, minValue: 0, maxValue: 500 }
                }, {
                    xtype: 'numbercolumn', header: 'z226', dataIndex: 'z226', width: 70, align: 'right', renderer: 'usMoney', sortable: false, menuDisabled: true,
                    editor: { xtype: 'numberfield', allowBlank: false, minValue: 0, maxValue: 500 }
                }, {
                    xtype: 'numbercolumn', header: 'z242', dataIndex: 'z242', width: 70, align: 'right', renderer: 'usMoney', sortable: false, menuDisabled: true,
                    editor: { xtype: 'numberfield', allowBlank: false, minValue: 0, maxValue: 500 }
                }, {
                    xtype: 'numbercolumn', header: 'z243', dataIndex: 'z243', width: 70, align: 'right', renderer: 'usMoney', sortable: false, menuDisabled: true,
                    editor: { xtype: 'numberfield', allowBlank: false, minValue: 0, maxValue: 500 }
                }, {
                    xtype: 'numbercolumn', header: 'z244', dataIndex: 'z244', width: 70, align: 'right', renderer: 'usMoney', sortable: false, menuDisabled: true,
                    editor: { xtype: 'numberfield', allowBlank: false, minValue: 0, maxValue: 500 }
                }, {
                    xtype: 'numbercolumn', header: 'z245', dataIndex: 'z245', width: 70, align: 'right', renderer: 'usMoney', sortable: false, menuDisabled: true,
                    editor: { xtype: 'numberfield', allowBlank: false, minValue: 0, maxValue: 500 }
                }, {
                    xtype: 'numbercolumn', header: 'z246', dataIndex: 'z246', width: 70, align: 'right', renderer: 'usMoney', sortable: false, menuDisabled: true,
                    editor: { xtype: 'numberfield', allowBlank: false, minValue: 0, maxValue: 500 }
                }, {
                    xtype: 'numbercolumn', header: 'z247', dataIndex: 'z247', width: 70, align: 'right', renderer: 'usMoney', sortable: false, menuDisabled: true,
                    editor: { xtype: 'numberfield', allowBlank: false, minValue: 0, maxValue: 500 }
                }, {
                    xtype: 'numbercolumn', header: 'z248', dataIndex: 'z248', width: 70, align: 'right', renderer: 'usMoney', sortable: false, menuDisabled: true,
                    editor: { xtype: 'numberfield', allowBlank: false, minValue: 0, maxValue: 500 }
                }, {
                    xtype: 'numbercolumn', header: 'z102', dataIndex: 'z102', width: 70, align: 'right', renderer: 'usMoney', sortable: false, menuDisabled: true,
                    editor: { xtype: 'numberfield', allowBlank: false, minValue: 0, maxValue: 500 }
                }, {
                    xtype: 'numbercolumn', header: 'z103', dataIndex: 'z103', width: 70, align: 'right', renderer: 'usMoney', sortable: false, menuDisabled: true,
                    editor: { xtype: 'numberfield', allowBlank: false, minValue: 0, maxValue: 500 }
                }, {
                    xtype: 'numbercolumn', header: 'z104', dataIndex: 'z104', width: 70, align: 'right', renderer: 'usMoney', sortable: false, menuDisabled: true,
                    editor: { xtype: 'numberfield', allowBlank: false, minValue: 0, maxValue: 500 }
                }, {
                    xtype: 'numbercolumn', header: 'z105', dataIndex: 'z105', width: 70, align: 'right', renderer: 'usMoney', sortable: false, menuDisabled: true,
                    editor: { xtype: 'numberfield', allowBlank: false, minValue: 0, maxValue: 500 }
                }, {
                    xtype: 'numbercolumn', header: 'z106', dataIndex: 'z106', width: 70, align: 'right', renderer: 'usMoney', sortable: false, menuDisabled: true,
                    editor: { xtype: 'numberfield', allowBlank: false, minValue: 0, maxValue: 500 }
                }, {
                    xtype: 'numbercolumn', header: 'z107', dataIndex: 'z107', width: 70, align: 'right', renderer: 'usMoney', sortable: false, menuDisabled: true,
                    editor: { xtype: 'numberfield', allowBlank: false, minValue: 0, maxValue: 500 }
                }, {
                    xtype: 'numbercolumn', header: 'z108', dataIndex: 'z108', width: 70, align: 'right', renderer: 'usMoney', sortable: false, menuDisabled: true,
                    editor: { xtype: 'numberfield', allowBlank: false, minValue: 0, maxValue: 500 }
                }, {
                    xtype: 'numbercolumn', header: 'z124', dataIndex: 'z124', width: 70, align: 'right', renderer: 'usMoney', sortable: false, menuDisabled: true,
                    editor: { xtype: 'numberfield', allowBlank: false, minValue: 0, maxValue: 500 }
                }, {
                    xtype: 'numbercolumn', header: 'z125', dataIndex: 'z125', width: 70, align: 'right', renderer: 'usMoney', sortable: false, menuDisabled: true,
                    editor: { xtype: 'numberfield', allowBlank: false, minValue: 0, maxValue: 500 }
                }, {
                    xtype: 'numbercolumn', header: 'z126', dataIndex: 'z126', width: 70, align: 'right', renderer: 'usMoney', sortable: false, menuDisabled: true,
                    editor: { xtype: 'numberfield', allowBlank: false, minValue: 0, maxValue: 500 }
                }, {
                    xtype: 'numbercolumn', header: 'z132', dataIndex: 'z132', width: 70, align: 'right', renderer: 'usMoney', sortable: false, menuDisabled: true,
                    editor: { xtype: 'numberfield', allowBlank: false, minValue: 0, maxValue: 500 }
                }, {
                    xtype: 'numbercolumn', header: 'z133', dataIndex: 'z133', width: 70, align: 'right', renderer: 'usMoney', sortable: false, menuDisabled: true,
                    editor: { xtype: 'numberfield', allowBlank: false, minValue: 0, maxValue: 500 }
                }, {
                    xtype: 'numbercolumn', header: 'z134', dataIndex: 'z134', width: 70, align: 'right', renderer: 'usMoney', sortable: false, menuDisabled: true,
                    editor: { xtype: 'numberfield', allowBlank: false, minValue: 0, maxValue: 500 }
                }, {
                    xtype: 'numbercolumn', header: 'z135', dataIndex: 'z135', width: 70, align: 'right', renderer: 'usMoney', sortable: false, menuDisabled: true,
                    editor: { xtype: 'numberfield', allowBlank: false, minValue: 0, maxValue: 500 }
                }, {
                    xtype: 'numbercolumn', header: 'z136', dataIndex: 'z136', width: 70, align: 'right', renderer: 'usMoney', sortable: false, menuDisabled: true,
                    editor: { xtype: 'numberfield', allowBlank: false, minValue: 0, maxValue: 500 }
                }, {
                    xtype: 'numbercolumn', header: 'z137', dataIndex: 'z137', width: 70, align: 'right', renderer: 'usMoney', sortable: false, menuDisabled: true,
                    editor: { xtype: 'numberfield', allowBlank: false, minValue: 0, maxValue: 500 }
                }, {
                    xtype: 'numbercolumn', header: 'z138', dataIndex: 'z138', width: 70, align: 'right', renderer: 'usMoney', sortable: false, menuDisabled: true,
                    editor: { xtype: 'numberfield', allowBlank: false, minValue: 0, maxValue: 500 }
                }, {
                    xtype: 'numbercolumn', header: 'z102_am', dataIndex: 'z102_am', width: 70, align: 'right', renderer: 'usMoney', sortable: false, menuDisabled: true,
                    editor: { xtype: 'numberfield', allowBlank: false, minValue: 0, maxValue: 500 }
                }, {
                    xtype: 'numbercolumn', header: 'z103_am', dataIndex: 'z103_am', width: 70, align: 'right', renderer: 'usMoney', sortable: false, menuDisabled: true,
                    editor: { xtype: 'numberfield', allowBlank: false, minValue: 0, maxValue: 500 }
                }, {
                    xtype: 'numbercolumn', header: 'z104_am', dataIndex: 'z104_am', width: 70, align: 'right', renderer: 'usMoney', sortable: false, menuDisabled: true,
                    editor: { xtype: 'numberfield', allowBlank: false, minValue: 0, maxValue: 500 }
                }, {
                    xtype: 'numbercolumn', header: 'z105_am', dataIndex: 'z105_am', width: 70, align: 'right', renderer: 'usMoney', sortable: false, menuDisabled: true,
                    editor: { xtype: 'numberfield', allowBlank: false, minValue: 0, maxValue: 500 }
                }, {
                    xtype: 'numbercolumn', header: 'z106_am', dataIndex: 'z106_am', width: 70, align: 'right', renderer: 'usMoney', sortable: false, menuDisabled: true,
                    editor: { xtype: 'numberfield', allowBlank: false, minValue: 0, maxValue: 500 }
                }, {
                    xtype: 'numbercolumn', header: 'z107_am', dataIndex: 'z107_am', width: 70, align: 'right', renderer: 'usMoney', sortable: false, menuDisabled: true,
                    editor: { xtype: 'numberfield', allowBlank: false, minValue: 0, maxValue: 500 }
                }, {
                    xtype: 'numbercolumn', header: 'z108_am', dataIndex: 'z108_am', width: 70, align: 'right', renderer: 'usMoney', sortable: false, menuDisabled: true,
                    editor: { xtype: 'numberfield', allowBlank: false, minValue: 0, maxValue: 500 }
                }, {
                    xtype: 'numbercolumn', header: 'z124_am', dataIndex: 'z124_am', width: 70, align: 'right', renderer: 'usMoney', sortable: false, menuDisabled: true,
                    editor: { xtype: 'numberfield', allowBlank: false, minValue: 0, maxValue: 500 }
                }
            ],
            dockedItems: [{
                xtype: 'pagingtoolbar',
                store: 'shipping.UPSRate',
                dock: 'bottom',
                displayInfo: true
            }],
            listeners: {
                render: function(grid) {
                    grid.getStore().load();
                }
            }
        });
        me.callParent(arguments);
    }
});
